<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>作文自动评分系统</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      padding: 20px;
    }
  .container {
      max-width: 600px;
      margin: 0 auto;
    }
  .input-group {
      margin-bottom: 20px;
    }
  .input-group label {
      display: block;
      margin-bottom: 5px;
    }
  .input-group textarea {
      width: 100%;
      height: 200px;
      padding: 10px;
      box-sizing: border-box;
    }
  .btn {
      padding: 10px 20px;
      background-color: #007BFF;
      color: white;
      border: none;
      cursor: pointer;
    }
  .result {
      margin-top: 20px;
      padding: 10px;
      border: 1px solid #ccc;
      background-color: #f9f9f9;
    }
  </style>
</head>
<body>
  <div id="app" class="container">
    <div class="input-group">
      <label for="essay">请输入作文内容：</label>
      <textarea id="essay" v-model="essayContent"></textarea>
    </div>
    <button class="btn" @click="submitEssay">获取评分</button>
    <div class="result" v-if="showResult">
      <p>作文评分：{{ score }}</p>
      <p>评分说明：{{ scoreExplanation }}</p>
    </div>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
  <script>
    new Vue({
      el: '#app',
      data: {
        essayContent: '',
        showResult: false,
        score: 0,
        scoreExplanation: ''
      },
      methods: {
        submitEssay() {
          // 这里模拟评分逻辑，实际应用中需要调用后端评分接口
          const length = this.essayContent.length;
          if (length < 100) {
            this.score = 30;
            this.scoreExplanation = '作文篇幅过短，内容可能不完整';
          } else if (length < 300) {
            this.score = 60;
            this.scoreExplanation = '作文篇幅适中，但内容丰富度有待提高';
          } else {
            this.score = 80;
            this.scoreExplanation = '作文篇幅合适，内容较为丰富';
          }
          this.showResult = true;
        }
      }
    });
  </script>
</body>
</html>